home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / text / misc / port / port.guide.text < prev    next >
Encoding:
Text File  |  1996-09-07  |  18.2 KB  |  453 lines

  1.  
  2. MAIN
  3.                                    Port
  4.  
  5.                   Copyright © 1993-1994 Henrik Tikanvaara
  6.                             All rights reserved
  7.  
  8.  
  9.                                    Index
  10.                                    ~~~~~
  11.  
  12.  Copyright      Copyright, distribution terms and contact address.
  13.  Introduction   Introduction to Port.
  14.  Instructions   General instructions.
  15.  Usage          Commandline usage and options.
  16.  Preferences    Port preferences file.
  17.  Misc stuff     Other notes.
  18.  History        History of changes.
  19.  Finally        Some final words.
  20.  Other prods    Information about other things I've coded.
  21.  
  22. copyright
  23.   This program is freeware, you may copy it on as long as there is no
  24. charge for the program (except for small handling fees if this program is
  25. distributed on a disk), and all of the files accompanying Port and Port
  26. itself are unaltered and remain intact. If you desire to put Port on a
  27. CD-ROM or in some other kind of PD-Shareware library, please contact me.
  28. The author accepts no responsibility whatsoever regarding Port, or anything
  29. else for that matter.
  30.   All donations will be gladly accepted, though checks and foreign
  31. currencies all have the problem with the banks charging monstrous fees to
  32. convert the money to Finnish marks. So don't send 'em, you'll be wasting
  33. your money. Finnish marks and US dollars are most welcome, as are also
  34. letters, chocolate, beer, disks, hardware etc. Sending something along a
  35. suggestion will have a very positive effect on its chances being done. =)
  36.  
  37. Contact addresses:
  38.  
  39. Mail:
  40.  
  41. Henrik Tikanvaara
  42. Tikasrinne 3A
  43. 02200  Espoo
  44. Finland
  45.  
  46. Internet:
  47.  
  48. In order of preference, only use the latter ones if you get no reply in 2
  49. weeks. I check my email once a week.
  50.  
  51. shadowlord@brahman.nullnet.fi
  52. sl@field.ichaos.nullnet.fi
  53. henrik.tikanvaara@mpoli.fi
  54.  
  55. intro
  56.   Have you ever got a textfile which had fine ASCII characters, but the
  57. accented characters were all wrong, and the file had a ^M after each line?
  58. You had probably found a textfile written on PC. Port translates the PC
  59. characters to their Amiga equivalents, or at least tries to make a very
  60. close match. It also knows how to translate a SF7 format textfile. More
  61. than this though, you can perform many other useful functions to textfiles,
  62. I really advise you take the time to get familiar with the different
  63. functions. Port can be viewed as a utility similar to a GFX converter, with
  64. the difference that it works on textfiles.
  65.  
  66. instructions
  67.   Port can only be run from the Shell, other than that, it should be very
  68. easy to use.  Everything in the commandline is case-sensitive.
  69.   The commandline is organized much like in LhA. First the options which
  70. are always prefaced by a dash, then the mode, and lastly the input and
  71. output filenames. The output filename is optional. Check Usage for a fast
  72. index of all different options.
  73.  
  74. usage
  75. Port V2.00
  76. Copyright © 1994 Henrik Tikanvaara
  77.  
  78. Usage: Port [Options] <Mode> <Source> [Dest]
  79.  
  80.   Mode                     Options
  81.   s  SF7->Amiga            -a  ANSI strip
  82.   p  PC ->Amiga            -b  No conversion buffer
  83.   c  Combined              -e# Make EOLs
  84.   S  Amiga->SF7            -i# InterNet strip (1-Note/2-Blank)
  85.   P  Amiga->PC             -l  LhA pack output file
  86.   l  Lowercase             -n  No endspace removal
  87.   u  Uppercase             -p  PowerPack output file
  88.   o  Only ASCII            -s# Spaces to tabs (Def 8)
  89.   n  Null                  -t# Tabs to spaces (Def 8)
  90.                            -?  Credits
  91.  
  92.   Source  The source filename to be converted.
  93.     Dest  The optional filename for the converted text.
  94.  
  95. combined
  96. "c"  Combined
  97.  
  98.   Decodes PC and SF7 characters to Amiga format. Useful for textfiles which
  99. have used the SF7 character set with the PC graphics characters etc.
  100.  
  101. prefs
  102.   Port has a preferences file, where you can specify options that you want
  103. to be active or inactive on every conversion. If you want to override the
  104. preferences options, it can be done by setting the option in the
  105. commandline, with an exclamation mark following it. For example, if you
  106. have spaces to tabs conversion on (-s), and you want to turn it off, write
  107. "-s!". After you have modified the options file to your preference, you
  108. must copy it to "ENV:" and "ENVARC:". If you are about to have conflicting
  109. options, you must first turn off the option you don't want, and then
  110. specify the other option. For example, you have specified SpacesToTabs
  111. conversion in the preferences, but now you want to use TabsToSpaces option.
  112. These options normally cause a conflict. In the commandline, first you have
  113. to write "-s!" (Suppress SpacesToTabs) and only after that you can specify
  114. "-t" (TabsToSpaces).
  115.  
  116. The following options can be specified in the preferences file:
  117.  
  118. ANSIStrip
  119. ConversionBuffer
  120. EndSpaceRemoval
  121. InterNetStrip
  122. LhAPack
  123. MakeEOLs
  124. PowerPackOutput
  125. SpacesToTabs
  126. TabsToSpaces
  127. TempDir
  128. TickDelay
  129.  
  130. ansistrip
  131.   Strips all ANSI codes from the file. Both $1B,"[" and $9B are understood
  132. as the CSI or Control Sequence Introducer.
  133.  
  134.  
  135.  
  136. instrip
  137.   Strips InterNet message headers from the textfile. If "1" is specified as
  138. the option, a text telling that a header was removed is inserted to each
  139. place where this was done. For "2", no text is inserted, the header is
  140. simply cut off.
  141.   This is done in the following way:
  142.   The input lines are scanned for starting with "From " or "Path: ". If the
  143. found text is "Path: ", then all the following lines are cut off, until an
  144. empty line is encountered. If the text is "From ", the line is also scanned
  145. for numbers and colons, which should be present if the line has a time
  146. stamp. If those conditions were fulfilled, the data is skipped until
  147. hitting an empty line. For the "From " part, this method should work pretty
  148. well, but the cut might accidentally be triggered if a normal line starts
  149. with "Path: ". Use with care.
  150.  
  151. lhaoutput
  152.   The output textfile is automatically packed with LhA. For this to work
  153. you have to have LhA in your path.
  154.  
  155. ppoutput
  156.   The output textfile is automatically packed using "powerpacker.library",
  157. with best compression and largest buffer size.
  158.  
  159. tempdir
  160.   Specifies where the temporary output textfile is written when a packing
  161. option is selected. You should use a directory in RAM: but if you run out
  162. of memory, you can set it somewhere else.
  163.  
  164. tickdelay
  165.   Specifies the delay between each progress report. Actually, it specifies
  166. the number of Vertical Blanks to wait before printing a new progress
  167. report. For normal PAL monitors, there are 50 VBlanks in a second, so
  168. setting this to 25 will result in 2 progress reports per second, 10 in 5
  169. and so on. NTSC monitors have 60 per second, and multisync have something
  170. like 70, I think. On my Amiga 1200 with fast RAM, I noticed that it doesn't
  171. affect the conversion speed by much on values at and over 15 VBlanks (with
  172. a monitor of 50 VBlanks per sec). A value between 15-50 is usually good for
  173. PAL systems. Setting the option off specifies 1 progress report per second.
  174.  
  175. opt_noconvbuf
  176. "-b"  No conversion buffer
  177.  
  178.   By default, Port reads the whole source file in memory and then converts
  179. and writes at the same time. But in case you're short of memory, this
  180. option makes Port read and write at the same time. This mode uses memory
  181. based on how much you have left, but with the lower limit of 100kB.
  182. Especially to floppy users with very little memory: use two different
  183. devices with this, if you don't want the conversion to be unreasonably
  184. slow. Some options don't work while this option is active.
  185.  
  186. makeeols
  187. "-e#"  Make EOLs
  188.  
  189.   Turns a string of at least # spaces into a linefeed. This option is
  190. useful if you saved a writer-routine's data from a demo or an intro in a
  191. textfile. Usually the text has no linefeeds, only some 10 spaces or so
  192. between each of the "lines". This way you can make the file much more
  193. readable. # can be 1-99.
  194.  
  195. endspace
  196. "-n"  No endspace removal
  197.  
  198.   By default Port removes all spaces and tabs that precede the end of the
  199. line. These are usually invisible to the user, and are left by the writer
  200. of the textfile by accident. Removing them shouldn't cause any harm, but it
  201. will reduce the size of the file. In case you need the spaces or tabs in
  202. the ends of the lines, use this option.
  203.  
  204. spacestotabs
  205. "-s#"  Spaces to tabs
  206.  
  207.   Tells Port to convert any strings of spaces and tabs to tabs, using # as
  208. the tabsize, in case it reduces the size of the textfile. # can be from 1
  209. to 16. Without size specification, 8 will be used. This option is very
  210. useful with charts and other textfiles with lots of spaces in them, because
  211. they get a lot smaller. It's a good idea to set this on as a default in
  212. your preferences file.
  213.  
  214. tabstospaces
  215. "-t#"  Tabs to spaces
  216.  
  217.   Convert any tabs to spaces. Tabsize used in the textfile is specified in
  218. #. # can be from 1 to 16. Without size specification, 8 will be used.
  219.  
  220. mode
  221.   Mode determines what Port expects the source file to be. Since almost all
  222. of the different character codes are used in different textfile formats,
  223. it's not easy to know what the format is just by looking what codes are
  224. there. So usually you should first take a look at the new textfile and
  225. determine what computer it has been written on.
  226.  
  227.   Attention!
  228.   Be careful when choosing your mode, if you choose a wrong mode, you can
  229. do irreversible damage to the textfile. Simply using the other mode pair
  230. (for example, PC->Amiga & Amiga->PC) will not be able to turn the file back
  231. into what it was, since many characters in one character set have no
  232. equivalents in other character sets, and those are translated to _similar_
  233. characters. In PC->Amiga mode a PC box character might be translated to a #
  234. sign, but when the # sign is converted back to PC, it stays as a # sign.
  235. When I made the PC->Amiga and Amiga->PC tables, I always first tried to
  236. find an equivalent character. If there was none, I then chose a close
  237. match. If there was a character with an accent, but the other format had no
  238. such character, I converted the accented character into its un-accented
  239. form. If there was an equal character, but in different case, then I
  240. translated into that without caring of the case. Since making the table is
  241. pretty repetitive work, I'm sure I made some mistakes. I happily change the
  242. translations, if you notice a mistake or have a better idea.
  243.  
  244. pctoami
  245. "p"  PC->Amiga
  246.  
  247.   Will strip all characters under $20 except TABs, LFs and ESCs and change
  248. all non-ASCII characters ($80-$FF) to the equivalents used on Amiga. Since
  249. Amiga's character set differs from the one used in PC, a close match is
  250. attempted when no equivalent exists. You should read the information about
  251. mode.
  252.  
  253.  
  254. sf7toami
  255. "s"  SF7->Amiga
  256.  
  257.   Strips all characters under $20 except TABs, LFs and ESCs, and translates
  258. the SF7 scands ("[{\|]}") to normal Amiga scands.
  259.  
  260. amitopc
  261. "P"  Amiga->PC
  262.  
  263.   Adds CR's to the end of each line and translates non-ASCII characters to
  264. their equivalents on PC. You should read the general information about
  265. mode.
  266.  
  267. amitosf7
  268. "S"  Amiga->SF7
  269.  
  270.   Strips all characters under $20 except TABs, LFs and ESCs, and translates
  271. scands which have an SF7 equivalent to the special SF7 form ("[{\|]}").
  272.  
  273. lowercase
  274. "l"  Lowercase
  275.  
  276.   Translates all characters to lowercase. IMPORTANT: This is done an Amiga
  277. file in mind. So if you try to translate a file of some other type, only
  278. the ASCII characters will be changed correctly, many non-ASCII characters
  279. will be mangled.
  280.  
  281. uppercase
  282. "u"  Uppercase
  283.  
  284.   Translates all characters to uppercase. IMPORTANT: This is done an Amiga
  285. file in mind. So if you try to translate a file of some other type, only
  286. the ASCII characters will be changed correctly, many non-ASCII characters
  287. will be mangled.
  288.  
  289. onlyasc
  290. "o"  Only ASCII
  291.  
  292.   Cuts all non-ASCII characters (ie. characters with a code higher than
  293. $7F), and a lot of characters under $20 from the file.
  294.  
  295. null
  296. "n"  Null
  297.  
  298.   This mode does no conversion, it only strips characters under $20 except
  299. TABs, LFs and ESCs. Use this when you want to do special operations, like
  300. tab conversion, on an any textfile.
  301.  
  302. source
  303. "Source"
  304.  
  305.   This is the name of the textfile(s) which you wish to convert. If the
  306. file has been PowerPacked, it will be automatically decrunched. You can use
  307. wildcards, since Port uses dos.library/MatchNext() to find the files.
  308.   If you use patterns, you can either specify no destination or the
  309. destination must be a directory. Port does not have an "ALL" option, which
  310. would convert all files recursively, but this can easily be accomplished by
  311. using a couple of a bit more complex patterns. For example, first "Port -s
  312. n #?", then "Port -s n #?/#?" and so on.
  313.  
  314. Here's a piece of the documentation for MatchFirst().
  315.  
  316.   The patterns are fairly extensive, and approximate some of the ability of
  317. Unix/grep "regular expression" patterns. Here are the available tokens:
  318.  
  319. ?       Matches a single character.
  320. #       Matches the following expression 0 or more times.
  321. (ab|cd) Matches any one of the items seperated by '|'.
  322. ~       Negates the following expression.  It matches all strings
  323.         that do not match the expression (aka ~(foo) matches all
  324.         strings that are not exactly "foo").
  325. [abc]   Character class: matches any of the characters in the class.
  326. [~bc]   Character class: matches any of the characters not in the
  327.         class.
  328. a-z     Character range (only within character classes).
  329. %       Matches 0 characters always (useful in "(foo|bar|%)").
  330. *       Synonym for "#?", not available by default in 2.0.  Available
  331.         as an option that can be turned on.
  332.  
  333. "Expression" in the above table means either a single character
  334. (ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
  335. class (ex: "#[a-zA-Z]").                
  336.  
  337. dest
  338.   This is the optional filename or the destination directory for the
  339. converted text. This doesn't have to be specified, in that case the
  340. original will be overwritten by the converted text. BEWARE! If the new
  341. textfile comes out bigger than the original and you run out diskspace, or
  342. some other similar error occurs, you will LOSE the file. If you are using
  343. the "No conversion buffer" option, the file will not be overwritten.
  344. Instead, a new file with the original name and some suffix will be used as
  345. the destination instead.
  346.  
  347. misc
  348. Aborting the conversion
  349. ~~~~~~~~~~~~~~~~~~~~~~~
  350.   The conversion can be aborted most of the time by pressing ^C. When using
  351. two different files for the source and destination, the conversion can
  352. always be aborted. But when converting on the original textfile, the
  353. conversion can only be aborted while Port is still reading. After it starts
  354. writing, you have to wait until it's finished. This is done to protect the
  355. textfile, otherwise everything would be lost.
  356.  
  357. End of conversion
  358. ~~~~~~~~~~~~~~~~~
  359.   In the end of the conversion, Port shows some information of the
  360. converted file compared to the original. The first number tells the change
  361. of size in bytes, and the second one the size of the converted file as a
  362. percentage of the original.
  363.  
  364. finalwords
  365.   Port V2.00, based on Port V1.46, was mainly developed between 18-May-94
  366. and 26-Jun-94 in about 90 hours of work. The source code size is currently
  367. approximately 4000 lines.
  368.  
  369.  
  370. Here are some personal hellos to my friends:
  371.  
  372. Axolotl/Capacala
  373. Did you have cool time in England and Germany? It will be interesting to
  374. see if more people come to Aggressive Party this year (do they have money
  375. to set it up anyway?) but it was kind of cool with so few people and so
  376. much space. Did alcohol have an effect? Nahh...
  377.  
  378. Breeze/Capacala
  379. I'm still quite unsure if I'll code an intro for Ass'94. Maybe, but just
  380. maybe.
  381.  
  382. Ged
  383. Your new text adventure system is great, it will be very easy and a lot of
  384. fun to make adventures for it, when it's finished.
  385.  
  386. Guru Gnosis Sahib
  387. Did you say Base? Just a moment, I gotta go to the bathroom, fast! Damn
  388. you, code the QWK reader soon, I won't use TIN anymore.
  389.  
  390. Otu
  391. Always fun to have around. Hope to see some more cyberpunk stories from you
  392. soon!
  393.  
  394. Passy/Capacala
  395. Your demo will be cool, but I'm afraid the quality of the PC compo will be
  396. TOUGH at Ass'94.
  397.  
  398.  
  399.   I have always thought that coding is clearly an art form. There are so
  400. many different ways to do things, some are just plain usual, some are
  401. exceedingly witty, and some are damn wicked. Such a shame only another
  402. coder can fully appreciate the work at that level. Anyway, I thought about
  403. the reasons I coded Port, and why I'm putting it into distribution. It
  404. sometimes just felt too good to be given everyone for free. But then I
  405. noted that a lot of cool programs I use have been made by other people like
  406. me, and they are for free too. I haven't sent money for any of them, though
  407. I have often been pretty close to doing so. But then I realized that the
  408. proper way to pay back is to code more good stuff since I'm able to do
  409. that. I think this is what everyone should do. If you have done some useful
  410. code for your own need, why don't you distribute it!
  411.  
  412.  
  413. Here's a list of coders I think have done nice work:
  414.  
  415. Stefan Boberg        - LhA
  416. Christoph Feck       - FJPEG
  417. Holger Kruse         - ReOrg
  418. Jarno Paananen       - S3M code
  419. Christophe Passuello - ShowGIF
  420.  
  421.  
  422.   Remember to write if you have some cool suggestions for features you'd
  423. like Port to have, or if you happen to find a bug. In case of a bug, tell
  424. me exactly what to do to make the bug appear, and send the textfile (or a
  425. part of it) which causes the bug, if possible. Also describe it well, if it
  426. isn't obvious. And write in any case if you're able; I want to know how
  427. many people are using Port! I know it's a pain to write real letters, but
  428. everyone can drop a note through Internet. And if you don't have email
  429. access, get it! You can get in touch with a lot of people around the world,
  430. for free. Why don't people use their modems to their full potential?
  431.  
  432.  
  433. For my newest programs and Internet email access, call
  434.                               ______
  435.     ________/\________/\  /\  \    |  /\___  ___/\   /\   /\__   ___
  436.     \        /\        /\/  \  \   | /\    \/    /  /  \  \   \ |   |
  437.     |\  ____/ /\  ____/ /\__/\ |\  |/ |\  _  _  /| /\__/\ |\__ \|   |
  438.     | \/  ___/\ \/     /      \| \_/  | \/|\/|\/ |/      \|   \ \__ |  
  439.     |         /   |    \  /\   \   |  |   |  |   /   /\   \   |\   \|
  440.     |________/|___|\___/ /  \   \__|__|___|  |__/   /  \   \__| \__ \
  441.    **[ggs]***********\  /****\  /***************\  /****\  /*******\/*
  442.                  _    \/      \/                 \/      \/
  443.  -=*=- Sysop: Guru Gnosis Sahib -=*=- Co-Sysops: Shadow Lord & X-Dus -=*=-
  444.  -=*=- AXsh v1.31 PL1 reg, 68030/25/7MB/320MB & USR 16800 DS -=*=-
  445.  
  446.  
  447.                                +358-0-498797
  448.                                ~~~~~~~~~~~~~
  449.  
  450.  
  451.   //
  452. \X/   Thanks to Amiga for being the coolest computer ever!
  453.